<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass="App\Repository\ShopStatisticRepository")
 */
class ShopStatistic
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\OneToOne(targetEntity="App\Entity\Shop", inversedBy="statistic", cascade={"persist", "remove"})
     * @ORM\JoinColumn(nullable=false)
     */
    private $shop;

    /**
     * @Groups({"home"})
     * @ORM\Column(type="integer")
     */
    private $orders;

    /**
     * @Groups({"home"})
     * @ORM\Column(type="integer")
     */
    private $products;

    /**
     * @Groups({"home"})
     * @ORM\Column(type="float")
     */
    private $incomes;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getShop(): ?Shop
    {
        return $this->shop;
    }

    public function setShop(Shop $shop): self
    {
        $this->shop = $shop;

        return $this;
    }

    public function getOrders(): ?int
    {
        return $this->orders;
    }

    public function setOrders(int $orders): self
    {
        $this->orders = $orders;

        return $this;
    }

    public function getProducts(): ?int
    {
        return $this->products;
    }

    public function setProducts(int $products): self
    {
        $this->products = $products;

        return $this;
    }

    public function getIncomes(): ?float
    {
        return $this->incomes;
    }

    public function setIncomes(float $incomes): self
    {
        $this->incomes = $incomes;

        return $this;
    }
}
